// class 

// old
function Person (name) {
    this.name = name
}
Person.prototype.say = function () {
    console.log(this.name)
}
const p1 = new Person("jary")
p1.say()

// new 
class newPerson {
    constructor(name) {
        this.name = name
    }
    say() {
        console.log(this.name)
    }
}
const p2 = new newPerson("toms")
p2.say()